package com.cj.designpattern.factory.simple;

import com.cj.designpattern.factory.simple.impl.LzNoodles;
import com.cj.designpattern.factory.simple.impl.PaoNoodles;
import com.cj.designpattern.factory.simple.impl.ReganNoodles;

/**
 * ClassName: SimpleNoodlesFactory <br/>
 * Function: 简单面条工厂类 <br/>
 * date: 2018/04/27 16:40 <br/>
 *
 * @author chenj
 * @version 1.0.0
 * @since JDK 1.8
 */
public class SimpleNoodlesFactory {

    public static final int TYPE_LZ = 1;    // 兰州拉面
    public static final int TYPE_PM = 2;    // 泡面
    public static final int TYPE_RG = 3;    // 热干面

    public static INoodles createNoodles(int type) {
        switch (type) {
            case TYPE_LZ:
                return new LzNoodles();
            case TYPE_PM:
                return new PaoNoodles();
            case TYPE_RG:
                return new ReganNoodles();
            default:
                return new ReganNoodles();
        }
    }
}
